package com.woniuxy.tfss.web.admin;


import com.woniuxy.tfss.entity.Perms;
import com.woniuxy.tfss.entity.ResponseEntity;
import com.woniuxy.tfss.service.PermsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.xml.ws.Response;
import java.util.List;

@Controller("adminPermsController")
@RequestMapping("admin/perm")
@CrossOrigin
@Slf4j
public class PermsController {
    @Autowired(required = false)
    private PermsService permsService;

    /**
     * 查询所有权限
     * @return
     */
    @GetMapping("list")
    @ResponseBody
    public ResponseEntity<List<Perms>> list(){
        List<Perms> perms=permsService.list();
        return new ResponseEntity<>(perms);
    }

}
